﻿<%@ page title="" language="C#" masterpagefile="~/AdminMasterPage.master" enableeventvalidation="false" autoeventwireup="true" inherits="PL_Accounts, App_Web_1zw2ahqk" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <style type="text/css">
        .auto-style5
        {
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <%-- <asp:UpdatePanel ID="UpdatePanel2" runat="server">
        <ContentTemplate>--%>
     <%-- <script language="javascript" type="text/javascript">
          function ShowHideOne() {
              if (document.getElementById('main').style.display == "none") {
                  document.getElementById('main').style.display = "block";

              }
              else {
                  document.getElementById('main').style.display = "none";
              }
              return false;

          }
    </script>--%>
    <%--<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional"   ChildrenAsTriggers="false">
             <ContentTemplate>--%>
    <div id="main"  style ="height: 847px; width: 822px;">

        <br />
        <asp:Label ID="ViewAccounts" runat="server" Font-Bold="True" Font-Size="Larger" ForeColor="Blue" Text="View Accounts"></asp:Label>
        <br />
        <br />

        <br />

      

        <asp:GridView ID="AccountsGridView" runat="server" AllowPaging="True" CellPadding="4" ForeColor="Black" OnPageIndexChanging="AccountsGridView_PageIndexChanging" PageSize="5" OnSelectedIndexChanged="AccountsGridView_SelectedIndexChanged" AutoGenerateColumns="False" BackColor="#CCCCCC" BorderColor="#999999" BorderStyle="Solid" BorderWidth="3px" CellSpacing="2" OnRowUpdating="AccountsGridView_RowUpdating" OnRowCommand="AccountsGridView_RowCommand" OnRowDataBound="AccountsGridView_RowDataBound" OnRowEditing="AccountsGridView_RowEditing">
             <Columns>

                <asp:TemplateField SortExpression="Account Id" HeaderText="Account Id">
                    <HeaderStyle Font-Bold="True" ForeColor="#FFFFCC" />
                    <ItemTemplate>
                        <asp:Label ID="AccountIdLbl" Text='<%# Eval("AccountId") %>' Visible="true" ForeColor="#990033" runat="server" />
                        <asp:TextBox ID="AccountIdTxtBx" Text='<%# Eval("AccountId") %>'  Visible="false" ForeColor="#990033" runat="server" />
                    </ItemTemplate>
                </asp:TemplateField>

                <asp:TemplateField SortExpression="Amount" HeaderText="Amount ">
                    <HeaderStyle Font-Bold="True" ForeColor="#FFFFCC" />
                    <ItemTemplate>

                        <asp:Label ID="AmountLbl" Text='<%# Eval("Amount") %>' Visible="true" ForeColor="#990033" runat="server" />
                        <asp:TextBox ID="AmountTxtBx" Text='<%# Eval("Amount") %>' Visible="false" ForeColor="#990033" runat="server" />
                    </ItemTemplate>
                </asp:TemplateField>

                <asp:TemplateField SortExpression="Branch Name" HeaderText="Branch Name ">
                    <HeaderStyle Font-Bold="True" ForeColor="#FFFFCC" />
                    <ItemTemplate>
                        <asp:Label ID="BranchNameLbl" Text='<%# Eval("BranchName") %>' Visible="true" ForeColor="#990033" runat="server" />
                        <asp:DropDownList ID="BranchNameDrpDwn" DataTextField="BranchName" DataValueField="BranchId" AppendDataBoundItems="True"
                            AutoPostBack="True" Visible="false" ForeColor="#990033" runat="server" />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField SortExpression="AccCreatedDate" HeaderText="Account Created Date">
                    <HeaderStyle Font-Bold="True" ForeColor="#FFFFCC" />
                    <ItemTemplate>
                        <asp:Label ID="AccCreatedDateLbl" Text='<%# Eval("AccCreatedDate", "{0:d}") %>' Visible="true" ForeColor="#990033" runat="server" />
                        <asp:TextBox ID="AccCreatedDateTxtBx" Text='<%# Eval("AccCreatedDate", "{0:d}") %>' Visible="false" ForeColor="#990033" runat="server" />
                    </ItemTemplate>
                </asp:TemplateField>



                <asp:TemplateField HeaderText="Update ">
                    <HeaderStyle Font-Bold="True" ForeColor="#FFFFCC" />

                    <ItemTemplate>
                        <asp:Button ID="UpdateBtn" runat="server" CommandName="update" Text="Update" OnClick="UpdateBtn_Click"></asp:Button>
                    </ItemTemplate>

                </asp:TemplateField>

                <asp:TemplateField HeaderText="Delete ">
                    <HeaderStyle Font-Bold="True" ForeColor="#FFFFCC" />

                    <ItemTemplate>
                        <asp:Button ID="DeleteBtn" runat="server" CommandName="delete" Text="Delete" OnClick="DeleteBtn_Click"></asp:Button>
                    </ItemTemplate>

                </asp:TemplateField>

                <asp:TemplateField HeaderText="Edit " Visible="false">
                    <HeaderStyle Font-Bold="True" ForeColor="#FFFFCC" />

                    <ItemTemplate>
                        <asp:Button ID="EditBtn" runat="server" CommandName="edit" OnClick="EditBtn_Click" Text="Edit"></asp:Button>
                    </ItemTemplate>

                </asp:TemplateField>


            </Columns>

            <FooterStyle BackColor="#CCCCCC" />
            <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#CCCCCC" ForeColor="Black" HorizontalAlign="Left" />
            <RowStyle BackColor="White" />
            <SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
            <SortedAscendingCellStyle BackColor="#F1F1F1" />
            <SortedAscendingHeaderStyle BackColor="#808080" />
            <SortedDescendingCellStyle BackColor="#CAC9C9" />
            <SortedDescendingHeaderStyle BackColor="#383838" />

        </asp:GridView>

        <br />
        <asp:Label ID="Note" runat="server" Font-Bold="True" Font-Size="Medium" ForeColor="Red"></asp:Label>

        <br />


        <asp:Label ID="UpdtDlt" runat="server" Font-Bold="True" Font-Size="Larger" ForeColor="#FF3300"></asp:Label>
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
         
        <table class="auto-style1">
            <tr>
                <td colspan="6">
                    <asp:Label ID="AccountsLbl" runat="server" Font-Bold="True" Font-Size="Larger" Text="Accounts" ForeColor="Blue"></asp:Label>
                </td>
            </tr>
            <tr>
                <td colspan="6">&nbsp;</td>
            </tr>
            <tr>
                <td align="left" class="auto-style5">
                    <asp:Label ID="AmountLbl" runat="server" Text="Amount" Font-Bold="True" ForeColor="#990033"></asp:Label>
                </td>
                <td align="left" class="auto-style5" colspan="4">
                    <asp:TextBox ID="AmountTxtBx" runat="server" CausesValidation="True"></asp:TextBox>
                </td>
                <td align="left" class="auto-style5">
                    <asp:RequiredFieldValidator ID="AmountTxtBxVldtr" runat="server" 
                        ControlToValidate="AmountTxtBx" ErrorMessage="Amount should not be empty"
                         ForeColor="#FF3300" ValidationGroup="a">*</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td align="left" colspan="6">&nbsp;</td>
            </tr>
            <tr>
                <td align="left" class="auto-style5" colspan="2">
                    <asp:Label ID="BranchIdLbl" runat="server" Text="Branch " Font-Bold="True" ForeColor="#990033"></asp:Label>
                </td>
                <td align="left" class="auto-style5" colspan="2">
                    <asp:DropDownList ID="BranchDropDown" runat="server" DataTextField="BranchName" 
                        DataValueField="BranchId" Height="16px" Width="122px" 
                        OnSelectedIndexChanged="BranchDropDown_SelectedIndexChanged" CausesValidation="True">
                    </asp:DropDownList>
                   
                </td>
                <td align="left" class="auto-style5" colspan="2">
                     <asp:CustomValidator ID="CustomValidator1" runat="server"
                        ValidationGroup="a" Font-Bold="True" ForeColor="Red"  
                          ErrorMessage="Start date must be less than end date" OnServerValidate="CustomValidator1_ServerValidate">*</asp:CustomValidator>
                    <asp:RequiredFieldValidator ID="BranchValdtr" 
                        runat="server" ErrorMessage="Select a branch" ForeColor="Red" 
                        ControlToValidate="BranchDropDown" ValidationGroup="a">*</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td align="left" colspan="6">&nbsp;</td>
            </tr>
            <tr>
                <td align="left" colspan="2">
                    <asp:Label ID="AccCrtdDtLbl" runat="server" Text="Account Created Date" Font-Bold="True" ForeColor="#990033"></asp:Label>
                </td>
                <td align="left" colspan="2">
                    <asp:TextBox ID="AccCrtdDtTxtBx" runat="server" CausesValidation="True" ReadOnly="True"></asp:TextBox>
                </td>
                <td align="left" colspan="2">
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="AccCrtdDtTxtBx" ErrorMessage="Account Created Date should not be empty" ForeColor="Red" ValidationGroup="a">*</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td align="left" class="auto-style5" colspan="3">&nbsp;</td>
                <td align="left" colspan="3">&nbsp;</td>

            </tr>
            <tr>
                <td align="center" colspan="6">
                    <asp:Button ID="AddBtn" runat="server"  OnClick="AddBtn_Click" Text="Add" ValidationGroup="a" />
                </td>
            </tr>
            <tr>
                <td align="center" colspan="6">
                    <asp:Label ID="DsplyLbl" runat="server" Font-Bold="True" Font-Size="Larger" ForeColor="Red" Visible="true"></asp:Label>
                </td>
            </tr>
            <tr>
                <td align="center" colspan="6">
                    <asp:ValidationSummary ID="ValidationSummary1" runat="server" Font-Bold="True" ForeColor="Red" Height="39px" ValidationGroup="a" Width="318px" />
                </td>
            </tr>
        </table>

    </div>
      
     
    
                 <%--  </ContentTemplate>
        
          </asp:UpdatePanel>--%>
        </asp:Content>

